<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_title_gallery_category', function (Blueprint $table) {
            $table->id();
            $table->integer('admin_id')->default(0)->comment('创建人');
            $table->string('category_name', 50)->default('')->comment('分类名称');
            $table->timestamps();
        });

        Schema::create('wechat_title', function (Blueprint $table) {
            $table->id();
            $table->integer('admin_id')->default(0)->comment('创建人');
            $table->integer('category_id')->default(0)->comment('分类ID');
            $table->string('title')->default('')->comment('标题名称');
            $table->timestamps();
        });


        Schema::create('wechat_gallery', function (Blueprint $table) {
            $table->id();
            $table->integer('admin_id')->default(0)->comment('创建人');
            $table->integer('category_id')->default(0)->comment('分类ID');
            $table->string('pic_name', 100)->default('')->comment('图片名称');
            $table->string('pic_url')->default('')->comment('图片地址');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_title_gallery_category');
        Schema::dropIfExists('wechat_title');
        Schema::dropIfExists('wechat_gallery');
    }
};
